#ifndef __LOGGER_H__
#define __LOGGER_H__

#include <iostream>
#include <string>
#include "log_base.h"
#include "singleton_t.h"
#include "lock.h"
#include "guard.h"
#include <stdint.h>

class CLogger
{
	static const uint32_t MAX_INPUT_BIN = 1024*40;
	static const uint32_t MAX_OUTPUT_HEX = MAX_INPUT_BIN * 5;
public:
    CLogger();
    ~CLogger();
public:
    int Initialize( const char* pszLogName);
	
    void Log(const char* sFormat, ...);

	void Log2Hex(const char* sLog, uint32_t nLen);

private:

    void DebugHexDump(
        const char*, uint32_t);
    
    uint32_t DebugHexDump_i(
        const char *pchInBuf,
        uint32_t nInBuf,
        char* pchOutBuf,
        uint32_t nOutBuf);

private:
    bool m_bInit;
    CLogBase m_oLogCtx;
	snda::comm::thread::CLock m_oDebugLock;	
    char m_achOBuf[MAX_OUTPUT_HEX+1];
};

#endif 
